package com.IR.product.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.IR.shop.mapper.ProductcommentMapper;
import com.IR.shop.po.Productcomment;
import com.IR.shop.po.ProductcommentExample;

@Service
public class BProductCommentBIZ {

	@Resource
	private ProductcommentMapper procommentmapper;
	
	/*分页展示单个商品评论*/
	public List<Productcomment> showProCommentPage(Integer pagenow,Integer pagesize,Integer proid){
		Integer start=(pagenow-1)*pagesize;//初始条数
		ProductcommentExample procommentexample=new ProductcommentExample();
		ProductcommentExample.Criteria c=procommentexample.createCriteria();
		c.andProidEqualTo(new Long(proid));
		procommentexample.setOffset(start);
		procommentexample.setLimit(pagesize);
		return procommentmapper.selectByExample(procommentexample);	
	}
	public List<Productcomment> showProCommentPage2(Integer pagenow,Integer pagesize){
		Integer start=(pagenow-1)*pagesize;//初始条数
		ProductcommentExample procommentexample=new ProductcommentExample();
		procommentexample.setOffset(start);
		procommentexample.setLimit(pagesize);
		return procommentmapper.selectByExample(procommentexample);	
	}
}
